<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id = "container" style="width: 300px;height: 300px;background-color: darkcyan;">

    </div>


    <script>
        document.querySelector("#container").addEventListener('mouseover',function(){
            console.log('鼠标移入了div')
        })

        document.querySelector("#container").addEventListener('mouseout',function(){
            console.log('鼠标离开了div')
        })

    </script>
</body>
</html>